
Rem
bbdoc: Game entity.
about: Use the TEntityManger to add and remove entites from the game
endrem
Type TEntity

	Field _position:TPosition
	Field _renderLayer:Int


	Method New()
		_position = New TPosition
	End Method


	'sets the render layer holding this entity.
	Method SetRenderLayer(index:Int)
		_renderLayer = index
	End Method


	'returns the render layer holding this entity.
	Method GetRenderLayer:Int()
		Return _renderLayer
	End Method


	'Returns the position type for this entity.
	Method GetPosition:TPosition()
		Return _position
	End Method



	Method Update() final
		_position.Update()
		Self.UpdateEntity()
	End Method


	Method Render(tween:Double) final
		_position.Interpolate(tween)
		Self.RenderEntity()
	End Method


	'user hook for update code
	Method UpdateEntity()
	End Method


	'user hook for render code
	'render code must use the renderpostion in the position type.
	Method RenderEntity()
	End Method


End Type

